<% layout('/layouts/default.html', {title: '通关缴税管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('通关缴税管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('financial:taxclearance:taxClearance:edit')){ %>
					<a href="${ctx}/financial/taxclearance/taxClearance/form" class="btn btn-default btnTool" title="${text('新增通关缴税')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${taxClearance}" action="${ctx}/financial/taxclearance/taxClearance/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('编号')}：</label>
					<div class="control-inline">
						<#form:input path="taxClearanceCode" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('服务订单')}：</label>
					<div class="control-inline width-120">
						<#form:select path="serviceOrderCode" items="${listServiceOrder}"
						itemLabel="serviceOrderCode" itemValue="serviceOrderId" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('车辆')}：</label>
					<div class="control-inline width-120">
						<#form:select path="carId" items="${tcarList}" itemLabel="carName" itemValue="carId"
						class="form-control required" blankOption="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('车架号')}：</label>
					<div class="control-inline width-120">
						<#form:select path="frameNumber" items="${frameNumberList}"
						itemLabel="frameNumber" itemValue="frameNumber" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('版型')}：</label>
					<div class="control-inline width-120">
						<#form:select path="area" dictType="car_quyu" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('报关行')}：</label>
					<div class="control-inline width-120">
						<#form:select path="customsBroker" items="${customsBrokerList}" itemLabel="supplierName" itemValue="supplierId"
						class="form-control required" blankOption="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('客户')}：</label>
					<div class="control-inline width-120">
						<#form:treeselect id="customer" title="${text('客户选择')}"
						path="customer.customerId" labelPath="customer.customerName"
						url="${ctx}/base/customer/customer/treeData" canSelectRoot="true" canSelectParent="true"
						class="" allowClear="true" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('国内资方')}：</label>
					<div class="control-inline width-120">
						<#form:select path="investorId" items="${gnzfList}" itemLabel="supplierName" itemValue="supplierId"
						class="form-control " blankOption="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('垫付方')}：</label>
					<div class="control-inline width-120">
						<#form:select path="prepaidId" items="${gnzfList}" itemLabel="supplierName" itemValue="supplierId"
						class="form-control " blankOption="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('状态')}：</label>
					<div class="control-inline width-120">
						<#form:select path="status1" dictType="tax_clearance_status" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('币种')}：</label>
					<div class="control-inline width-120">
						<#form:select path="currency" dictType="sys_bizhong" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('缴税方式')}：</label>
					<div class="control-inline width-120">
						<#form:select path="taxPaymentMethod" dictType="tax_payment_method" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('缴税截止日期')}：</label>
					<div class="control-inline">
						<#form:input path="taxPaymentDeadline_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="taxPaymentDeadline_lte.click()"/>
						&nbsp;-&nbsp;
						<#form:input path="taxPaymentDeadline_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
					</div>
				</div>
<!--				<div class="form-group">-->
<!--					<label class="control-label">${text('垫税模式')}：</label>-->
<!--					<div class="control-inline">-->
<!--						<#form:input path="padTaxMode" maxlength="2" class="form-control width-120"/>-->
<!--					</div>-->
<!--				</div>-->
				<div class="form-group">
					<label class="control-label">${text('出税日期')}：</label>
					<div class="control-inline">
						<#form:input path="taxDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="taxDate_lte.click()"/>
						&nbsp;-&nbsp;
						<#form:input path="taxDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('缴税日期')}：</label>
					<div class="control-inline">
						<#form:input path="taxPaymentDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="taxPaymentDate_lte.click()"/>
						&nbsp;-&nbsp;
						<#form:input path="taxPaymentDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('实际还款日期')}：</label>
					<div class="control-inline">
						<#form:input path="investorActualRepaymentDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="investorActualRepaymentDate_lte.click()"/>
						&nbsp;-&nbsp;
						<#form:input path="investorActualRepaymentDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('实际还款日期')}：</label>
					<div class="control-inline">
						<#form:input path="customerActualRepaymentDate_gte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="customerActualRepaymentDate_lte.click()"/>
						&nbsp;-&nbsp;
						<#form:input path="customerActualRepaymentDate_lte" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('创建者')}：</label>
					<div class="control-inline width-120">
						<#form:select path="createBy" items="${listUser}"
						itemLabel="userName" itemValue="userCode" blankOption="true" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('创建时间')}：</label>
					<div class="control-inline">
						<#form:input path="createDate" readonly="true" maxlength="20" class="form-control laydate width-date"
							dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("编号")}', name:'taxClearanceCode', index:'a.tax_clearance_code', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/financial/taxclearance/taxClearance/detail?taxClearanceId='+row.taxClearanceId+'" class="btnList" data-title="${text("编辑通关缴税")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("操作")}', name:'actions', width:140, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('financial:taxclearance:taxClearance:view')){ %>
			actions.push('<a href="${ctx}/financial/taxclearance/taxClearance/detail?taxClearanceId='+row.taxClearanceId+'" class="btnList" title="${text("查看通关缴税")}"><i class="fa fa-file-text-o"></i></a>&nbsp;');
			<% } %>
			<% if(hasPermi('financial:taxclearance:taxClearance:edit')){ %>
			actions.push('<a href="${ctx}/financial/taxclearance/taxClearance/form?taxClearanceId='+row.taxClearanceId+'" class="btnList" title="${text("编辑通关缴税")}"><i class="fa fa-pencil"></i></a>&nbsp;');
	<% } %>
<% if(hasPermi('financial:taxclearance:taxClearance:delete')){ %>
				actions.push('<a href="${ctx}/financial/taxclearance/taxClearance/delete?taxClearanceId='+row.taxClearanceId+'" class="btnList" title="${text("删除通关缴税")}" data-confirm="${text("确认要删除该通关缴税吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}},
		{header:'${text("服务订单")}', name:'serviceOrder.serviceOrderCode', index:'a.service_order_id', width:150, align:"center"},
		{header:'${text("车辆")}', name:'tcar.carName', index:'a.car_id', width:150, align:"left"},
		{header:'${text("车架号")}', name:'frameNumber', index:'a.frame_number', width:150, align:"center"},
		{header:'${text("版型")}', name:'area', index:'a.area', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('car_quyu')}, val, '${text("未知")}', true);
		}},
		{header:'${text("报关行")}', name:'supplier.supplierName', index:'a.customs_broker', width:150, align:"center"},
		{header:'${text("客户")}', name:'customer.customerName', index:'a.customer_id', width:150, align:"center"},
		{header:'${text("国内资方")}', name:'investor.supplierName', index:'a.investor_id', width:150, align:"center"},
		{header:'${text("垫付方")}', name:'prepaid.supplierName', index:'a.prepaid_id', width:150, align:"center"},
		{header:'${text("状态")}', name:'status1', index:'a.status1', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('tax_clearance_status')}, val, '${text("未知")}', true);
		}},
		{header:'${text("申报价格")}', name:'declaredPrice', index:'a.declared_price', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("出税价格")}', name:'taxPrice', index:'a.tax_price', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("差额")}', name:'difference', index:'a.difference', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("海关综合税率")}', name:'customsCombinedTaxRate', index:'a.customs_combined_tax_rate', width:150, align:"left"},
		{header:'${text("综合税金")}', name:'comprehensiveTax', index:'a.comprehensive_tax', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("外币价格")}', name:'foreignCurrencyPrice', index:'a.foreign_currency_price', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("海关汇率")}', name:'customsExchangeRate', index:'a.customs_exchange_rate', width:150, align:"left"},
		{header:'${text("币种")}', name:'currency', index:'a.currency', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_bizhong')}, val, '${text("未知")}', true);
		}},
		{header:'${text("缴税方式")}', name:'taxPaymentMethod', index:'a.tax_payment_method', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('tax_payment_method')}, val, '${text("未知")}', true);
		}},
		{header:'${text("缴税截止日期")}', name:'taxPaymentDeadline', index:'a.tax_payment_deadline', width:150, align:"center"},
		{header:'${text("垫税模式")}', name:'padTaxMode', index:'a.pad_tax_mode', width:150, align:"left"},
		{header:'${text("出税日期")}', name:'taxDate', index:'a.tax_date', width:150, align:"center"},
		{header:'${text("缴税日期")}', name:'taxPaymentDate', index:'a.tax_payment_date', width:150, align:"center"},
		{header:'${text("代垫金额")}', name:'prepaidAmount', index:'a.prepaid_amount', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("代收代付金额")}', name:'amount', index:'a.amount', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("垫税说明")}', name:'padTaxMemo', index:'a.pad_tax_memo', width:150, align:"left"},
		{header:'${text("延期说明")}', name:'delayMemo', index:'a.delay_memo', width:150, align:"left"},
		{header:'${text("实际还款日期")}', name:'investorActualRepaymentDate', index:'a.investor_actual_repayment_date', width:150, align:"center"},
		{header:'${text("实际天数")}', name:'investorActualDays', index:'a.investor_actual_days', width:150, align:"center"},
		{header:'${text("付款实时利息")}', name:'investorRealTimeInterest', index:'a.investor_real_time_interest', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("付款实际利息")}', name:'investorActualInterest', index:'a.investor_actual_interest', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("实际还款日期")}', name:'customerActualRepaymentDate', index:'a.customer_actual_repayment_date', width:150, align:"center"},
		{header:'${text("实际天数")}', name:'customerActualDays', index:'a.customer_actual_days', width:150, align:"center"},
		{header:'${text("收款实时利息")}', name:'customerRealTimeInterest', index:'a.customer_real_time_interest', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("收款实际利息")}', name:'customerActualInterest', index:'a.customer_actual_interest', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("创建者")}', name:'createBy', index:'a.create_by', width:150, align:"left"},
		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
		{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
	],
frozenCols: true,
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>